#include <stdio.h>
#include <stdlib.h>

#define BUFSIZE 256
	int main(int argc,char **argv)
{
	FILE *fps,*fpd;
	char buff[BUFSIZE] = {0};

	if(argc < 3)
	{
		fprintf(stderr,"uage:%s\n",argv[0]);
		exit(1);
	}

	fps = fopen(argv[1],"ab+");
	if(fps == NULL)
	{
		perror("fopen()");
		exit(1);
	}
	fpd = fopen(argv[2],"ab+");
	if(fpd == NULL)
	{
		perror("fopen()");
		exit(1);
	}
	
	while(fgets(buff,BUFSIZE-1,fps) != NULL)
	{
		fputs(buff,fpd);
	}

	fclose(fpd);
	fclose(fps);

	exit(0);
}

